<?php  
//    include("conn.php");
$hostname_conn = "localhost";
$database_conn = "xdq";
$username_conn = "root";//没改的话一般时root
$password_conn = "123456";
$lessonid= $_POST['id'];
$conn = mysqli_connect($hostname_conn, $username_conn, $password_conn,$database_conn)or trigger_error(mysqli_error(),E_USER_ERROR);

    $userid = $_POST['userid']; 
    $newname = $_POST['newname']; 
    $newxuehao = $_POST['newxuehao']; 

    $sql = "update student set name='$newname',xuehao='$newxuehao',ischange=1 where openid = '$userid'";  

    if (mysqli_query($conn, $sql)) {
       echo "true";
    }else {
         echo "false" ; 
    }
 
?>  